<script src="/js/plugins/echarts/echarts.common.min.js"></script>
            <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
            <div id="main" style="width: 900px;height:600px;"></div>

            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('main'));

                var option = {
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'cross',
                            crossStyle: {
                                color: '#999'
                            }
                        }
                    },
                    toolbox: {
                        feature: {
                            dataView: {show: true, readOnly: false},
                            magicType: {show: true, type: ['line', 'bar']},
                            restore: {show: true},
                            saveAsImage: {show: true}
                        }
                    },
                    legend: {
                        data: ['总消费金额', '总优惠金额', '总实收金额', '订单数']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: ${groupTypes},
                            axisPointer: {
                                type: 'shadow'
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            name: '金额',
                            min: 0,
                            axisLabel: {
                                formatter: '{value} ￥'
                            }
                        },
                        {
                            type: 'value',
                            name: '数量',
                            min: 0,
                            interval: 5,
                            axisLabel: {
                                formatter: '{value} 个'
                            }
                        }
                    ],
                    series: [
                        {
                            name: '总消费金额',
                            type: 'bar',
                            data: ${totalAmounts},
                        },
                        {
                            name: '总优惠金额',
                            type: 'bar',
                            data: ${totalDiscountAmounts},
                        },
                        {
                            name: '总实收金额',
                            type: 'bar',
                            data: ${totalPayAmounts}
                        },
                        {
                            name: '订单数',
                            type: 'line',
                            yAxisIndex: 1,
                            data: ${counts}
                        }
                    ]
                };

                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            </script>
